package com.chaopei.day11;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author Corday 天涯
 * @Date 2022/3/17 16:30
 * 完成具体功能的类
 */
public class MyPool {
    //设置多个控制参数,比如结束标志
    private ExecutorService es;
    private boolean flag;
    public MyPool() {
    }

    public MyPool(ExecutorService es,boolean flag) {
        this.es = es;
        this.flag = flag;
    }

    public void play() {
        es.execute(new Runnable() {
            @Override
            public void run() {
                System.out.println("线程池共享代码");
                //想办法结束线程池对象es
            }
        });
    }
}
